import java.util.Scanner;

public class Main1418 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt();
        int x=a%10;//5
        int y=(a/10)%10;//4
        int z=(a/100)%10;//3
        int j=(a/1000)%10;//2
        int k=a/10000;
        int b=x+y+z+j+k;
        System.out.println(b);
    }
}
